<script>
import GmTable from "@/view/components/gmTable.vue";

export default {
  components: {
    GmTable: GmTable
  },
  data() {
    return {
      tableConfig: {
        control: 't-route',
        mainKey: 'routeCode',//数据主键，用于删除该条数据
        cancelPower: true,
      },
      tableColumns: [{
        name: 'routeName',
        label: '站点路线名称',
        id: 'routeName',
        search: true,
        required: false,
        searchType: 'input',
      }, {
        name: 'routeCode',
        label: '站点路线编码',
        id: 'routeCode',
        hide:true,
        addHide: true,
        search: true,
        required: false,
        searchType: 'input',
      }, {
        name: 'stationCodeStartEn',
        label: '起点站点',
        id: 'stationCodeStartEn',
        search: false,
        required: '/t-station/findPage',
        props: {
          label: 'stationName',
          value: 'stationCode'
        },
        searchType: 'select',
        getValue: function (obj) {
          return obj.stationName
        }
      },{
        name: 'passingPoindCodeEns',
        label: '途径点',
        id: 'passingPoindCodeEns',
        search: true,
        notMust: true,
        required: '/t-station/findPage',
        props: {
          label: 'stationName',
          value: 'stationCode'
        },
        searchType: 'more-select',
        getValue: function (obj) {
          let s = ''
          obj.forEach(x => {
            s += `${x.description},`
          })
          return s
        }
      }, {
        name: 'stationCodeEndEn',
        label: '终点站点',
        id: 'stationCodeEndEn',
        search: false,
        required: '/t-station/findPage',
        props: {
          label: 'stationName',
          value: 'stationCode'
        },
        searchType: 'select',
        getValue: function (obj) {
          return obj.stationName
        }
      },{
        name: 'createDate',
        label: '创建时间',
        id: 'createDate',
        search: false,
        searchType: 'state',
        addHide: true,
      },{
        name: 'createUser',
        label: '创建人',
        id: 'createUser',
        search: false,
        searchType: 'state',
        addHide: true,
      },{
        name: 'state',
        label: '状态',
        id: 'state',
        search: false,
        required: '/common/getItem/state',
        searchType: 'state',
        notMust: true,
      }],
    }
  },
}
</script>

<template>
  <div class="page-car">
    <gm-table :table-columns="tableColumns" :table-config="tableConfig"></gm-table>
  </div>
</template>

<style scoped>

</style>
